package com.ticket.sass.admin.service.impl;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ticket.sass.admin.mapper.TenantAccountMapper;
import com.ticket.sass.admin.service.BaseService;
import com.ticket.sass.common.entity.tenant.TenantAccountEntity;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author ywb
 * @since 2024-03-19
 */
@Service
public class TenantAccountServiceImpl extends ServiceImpl<TenantAccountMapper, TenantAccountEntity> implements BaseService<TenantAccountEntity> {
    public BigDecimal getBalance() {
        QueryWrapper<TenantAccountEntity> queryWrapper = new QueryWrapper<>();
        queryWrapper.select("balance");
        TenantAccountEntity entity = this.baseMapper.selectOne(queryWrapper);
        return entity != null ? entity.getBalance() : null;
    }

}
